package {
	import Tian7.DataProvider;
	import Tian7.Layout;
	
	import flash.display.MovieClip;
	import flash.display.StageAlign;
	import flash.display.StageScaleMode;
	import flash.events.Event;
	import flash.net.URLRequest;
	/**
	 * 入口和配置
	 * @author Kakera
	 * 
	 */
	public class App extends MovieClip
	{
		public const service:String = "http://aw.awflasher.com/ChinaWeatherCn.xml";
		public const align:String = StageAlign.TOP_LEFT;
		public const scaleMode:String = StageScaleMode.NO_SCALE;
		public const appWidth:int = 0;
		public const appHeight:int = 0;
		public const iconFolder:String = "";
		public const version:String = "1.0";
				
		public static var instance:App;

		private var provider:DataProvider = new DataProvider();
		private var layout:Layout = new Layout();
		
		public function App()
		{
			provider.addEventListener(Event.COMPLETE, function (event:Event):void {
				layout.data = event.target.result;
			} );
			
			provider.load( new URLRequest(service) );
			
			stage.scaleMode = scaleMode;
			stage.align = align;
			
			addChild( layout );
			
			instance = this;
		}
		
	}
}
